﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FaultBackService.DAL
{
    class RealTimeFault
    {
        /// <summary>
        /// 获取所有的实时故障列表
        /// </summary>
        /// <returns></returns>
        internal IList<Models.RealTimeFault> GetAll()
        {
            using (Models.TurbineFaultContext context = new Models.TurbineFaultContext())
            {
                return context.RealTimeFault.ToList();
            }
        }

        /// <summary>
        /// 返回Fault字典
        /// </summary>
        /// <returns></returns>
        internal IDictionary<int, Models.RealTimeFault> GetDict()
        {
            using (Models.TurbineFaultContext context = new Models.TurbineFaultContext())
            {
                return context.RealTimeFault
                    .ToDictionary(f => f.FaultId);
            }
        }
    }
}
